<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBroadcastsTable extends Migration
{
    public function up()
    {
        Schema::create('broadcasts', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('admin_user_id')->default(0)->comment('who published broadcast');
            $table->string('type')->nullable();
            $table->text('message')->nullable();
            $table->text('data')->nullable()->comment('data');
            $table->dateTime('expired_at')->nullable();
            $table->boolean('is_closed')->default(false);
            $table->timestamps();
        });
    }
    
    public function down()
    {
        Schema::dropIfExists('broadcasts');
    }
}
